home *** CD-ROM | disk | FTP | other *** search
- Components.utils.import("resource://samfind/rss/samfind_modrssutils.jsm");
-
- var EXPORTED_SYMBOLS = ["samfindRSSGetLink", "samfindRSSGetTitle", "samfindRSSGetDate", "samfindRSSGetImage", "samfindRSSGetContent"];
-
- function samfindRSSGetLink(websiteRssUrl, item)
- {
- return null;
- }
-
- function samfindRSSGetTitle(websiteRssUrl, item)
- {
- return null;
- }
-
- function samfindRSSGetDate(websiteRssUrl, item)
- {
- return null;
- }
-
- function samfindRSSGetImage(websiteRssUrl, item)
- {
- return null;
- }
-
- function samfindRSSGetContent(websiteRssUrl, item, title, link)
- {
- var content = (item.getElementsByTagName("description"))[0];
- if (!content)
- {
- return null;
- }
- var response = content.textContent;
- response = response.replace(/&(lt|gt);/g, function(strMatch, p1){return (p1 == "lt") ? "<" : ">";});
- response = response.replace(/<\/?[^>]+(>|$)/g, " ");
- response = samfind_modrssutils.HTML2Text(response);
- response += '<table cellpadding="0" cellspacing="0"><tr>';
- var diggs = (item.getElementsByTagNameNS("http://digg.com/docs/diggrss/", "diggCount"))[0];
- if (diggs)
- {
- response += '<td class="diggs" valign="center"><a href="' + link + '">' + diggs.textContent + '</a></td>';
- }
- var comments = (item.getElementsByTagNameNS("http://digg.com/docs/diggrss/", "commentCount"))[0];
- if (comments)
- {
- response += '<td class="comments" valign="center"><a href="' + link + '">' + comments.textContent + ' comments</a></td>';
- }
- var submitter = (item.getElementsByTagNameNS("http://digg.com/docs/diggrss/", "username"))[0];
- if (submitter)
- {
- submitter = submitter.textContent;
- response += '<td valign="center"><a href="http://digg.com/users/' + submitter + '"><img src="http://digg.com/users/' + submitter + '/l.png" width="24" height="24" border="0"/></a></td>';
- response += '<td class="submitter" valign="center"><a href="http://digg.com/users/' + submitter + '">' + submitter + '</a></td>';
- }
- response += '</tr></table>';
- return response;
- }